class Task38:
    def run(self, string):
        result = set()
        if string == '':
            return result
        char_list = list(string)
        self.run_inner(char_list, 0, result)
        return result

    def run_inner(self, char_list, index, result):
        if index == len(char_list) - 1:
            result.add(''.join(char_list))
        else:
            for i in range(index, len(char_list)):
                char_list[i], char_list[index] = char_list[index], char_list[i]
                self.run_inner(char_list, index + 1, result)
                char_list[i], char_list[index] = char_list[index], char_list[i]
